﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SharedGamesClasses;

namespace GuiGames
{
    public partial class ChooseSuitForm : Form
    {
        private CrazyEightsForm crazyForm;
        Card card;
        public ChooseSuitForm(CrazyEightsForm crazyForm, Card _card)
        {
            InitializeComponent();
            this.crazyForm = crazyForm;
            card = _card;
        }
       
        public Suit GetSuit()
        {
            Suit suit = new Suit();

            if (rdbClubs.Checked)
            {
                suit = Suit.Clubs;
                return suit;
            }
            if (rdbDiamonds.Checked)
            {
                suit = Suit.Diamonds;
                return suit;
            }
            if (rdbHearts.Checked)
            {
                suit = Suit.Hearts;
                return suit;
            }
            if (rdbSpades.Checked)
            {
                suit = Suit.Spades;
                return suit;
            }
            return suit;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            
            CrazyEights.SetCurrentSuit(GetSuit());
            this.crazyForm.Show();
            this.crazyForm.ContinueDrawCard(card);
            this.Close();
        }

       
    }
}
